package com.yc.usercenterbackend.demos.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yc.usercenterbackend.demos.model.domin.User;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author WangJiYou
 * @description 针对表【user(用户)】的数据库操作Service
 * @createDate 2024-01-10 11:15:40
 */
public interface UserService extends IService<User> {


    /**
     * 用户注册
     *
     * @param userAccount   账号
     * @param userPassword  密码
     * @param checkPassword 校验码
     * @param planeCode
     * @return
     */
    Long userRegister(String userAccount, String userPassword, String checkPassword, String planeCode);

    /**
     * 用户登录
     *
     * @param userAccount  账号
     * @param userPassword 密码
     * @return
     */
    User userLogin(String userAccount, String userPassword, HttpServletRequest request);


    /**
     * 用户脱敏
     *
     * @param user
     * @return
     */
    User getSafetyUser(User user);

    /**
     * 用户注销
     *
     * @param request
     * @return
     */
    int userLogout(HttpServletRequest request);

    List<User> searchUserByTags(List<String> tagNameList);

    /**
     * 更新用户信息
     *
     * @param user
     * @return
     */
    Boolean updateUser(User user, User loginUser);

    boolean isAdmin(HttpServletRequest request);

    boolean isAdmin(User loginUser);

    /**
     * 获取当前用户信息
     *
     * @return
     */
    User getLoginUser(HttpServletRequest request);


    /**
     * 匹配最匹配的用户
     *
     * @param num
     * @param loginUser
     * @return
     */
    List<User> matchUsers(long num, User loginUser);


}
